package com.arsProfundis
package services

import akka.actor.{ActorSystem, Props}
import cc.spray._


class Boot(system: ActorSystem) {

    val mainModule = new SmartDreamerService {
      implicit def actorSystem = system
    }

    val httpService = system.actorOf(
      props = Props(new HttpService(mainModule.service)),
      name = "smartDreamer-service"
    )

    val rootService = system.actorOf(
      props = Props(new RootService(httpService)),
      name = "spray-root-service"
    )

    system.registerOnTermination {
      system.log.info("Application shut down")
    }
}
